SetUserDataItem
TheSetUserDataItem
allows your application to set an item in a user data list. You specify the user data list, the data to be set, the size of the data to be set, and the data's type value.
pascal OSErr SetUserDataItem (UserData theUserData, void *data, long size, long udType, long index);
theUserData
Specifies the user data list for this operation. You obtain this item reference by calling theGetMovieUserData
,GetTrackUserData
, orGetMediaUserData
function (described on page 2-215, page 2-216, and page 2-217, respectively).data
- Contains a pointer to the data item to be set in a user data list.
size
- Specifies the size of the information pointed to by the
data
parameter.udType
- Specifies the type value assigned to the new item.
index
- Specifies the item's index value. This parameter must specify an item in the user data list identified by the parameter
theUserData
. An index value of 0 or 1 implies the first item, which is created if it doesn't
already exist.DESCRIPTION
You must provide the size of the information specified in thedata
parameter because the data may be embedded inside a larger data structure or may be on the stack.SPECIAL CONSIDERATIONS
The data pointer must be locked, sinceSetUserDataItem
may move memory.SEE ALSO
TheSetUserDataItem
function is a pointer-based version ofAddUserData
, which is described on page 2-219.ERROR CODES
Memory Manager errors